CREATE TABLE [dbo].[Photo]
(
[PhotoId] [int] NOT NULL IDENTITY(1, 1),
[ProductId] [int] NOT NULL,
[FileName] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NOT NULL,
[MimeType] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NULL,
[FileSize] [int] NOT NULL,
[Description] [nvarchar] (256) COLLATE Cyrillic_General_CI_AS NULL,
[CreatedDate] [datetime] NOT NULL,
[LastModifiedDate] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Photo] ADD CONSTRAINT [PK_Photo] PRIMARY KEY CLUSTERED  ([PhotoId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Photo] ADD CONSTRAINT [FK_Photo_Product] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product] ([ProductId])
GO
